package com.lanou3g.ptp.api.config;

import com.lanou3g.ptp.api.resolver.SsoStudentArgumentResolver;
import com.lanou3g.ptp.api.resolver.SsoTeacherArgumentResolver;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.List;

/**
 * 创建人: 武奇
 * 创建事件: 2019/8/15
 */
@Configuration
public class PtpMvcConfig implements WebMvcConfigurer {

    @Bean
    public SsoTeacherArgumentResolver ssoTeacherArgumentResolver() {
        return new SsoTeacherArgumentResolver();
    }

    @Bean
    public SsoStudentArgumentResolver ssoStudentArgumentResolver() {
        return new SsoStudentArgumentResolver();
    }

    @Override
    public void addArgumentResolvers(List<HandlerMethodArgumentResolver> resolvers) {
        resolvers.add(ssoTeacherArgumentResolver());
        resolvers.add(ssoStudentArgumentResolver());
    }
}
